<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>此处为通过笔试等待面试的应聘者</title>
			<link rel="stylesheet" href="../static/css/xadmin.css">
			<link rel="stylesheet" href="../static/css/xadmin.css">
			<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
			<script src="../static/lib/layui/layui.js" charset="utf-8"></script>
			<script type="text/javascript" src="../static/js/xadmin.js"></script>
			<script src="../static/js/my.js"></script>
	</head>
	<body>
		<h1 align="center" style="color: #FF0000;">此处为通过笔试等待面试的应聘者</h1>
		<table  class="layui-table" id="table">
		    <thead>
		    <th>编号</th>
		    <th>姓名</th>
		    <th>性别</th>
			<th>出生日期</th>
		    <th>联系电话</th>
			<th>邮箱</th>
			<th>应聘时间</th>
			<th>笔试成绩</th>
			<th>笔试评价</th>
			<th>状态</th>
			<th>操作</th>
			
		    </thead>
		    <tbody>
		  
		    </tbody>
		</table>
		<input align="center" type="button" class="layui-btn layui-btn-radius layui-btn-warm" onclick="bi()" value="<<=应聘者总览" >
		
		
	</body>
	
<script>
	
	//文档加载事件
	$(function(){
			//在文档加载时查询所有考勤记录
		
		
			selectMoney();
			
			
		})
	function selectMoney()
	{
		var pass="通过笔试";
		$.ajax({
				url:address+"/offer/passAjax",
				type:"get",
				data:{"pass":pass},
				dataType:"json",
				success:function (data) {
				   
				   //遍历分页数据,拼接字符串
				  
				 var html="";
				 for(var i=0;i<data.length;i++)
				 {
					 html+="<tr>"
							+"<td >"+data[i].userId+"</td>"
							+"<td >"+data[i].userName+"</td>"
							+"<td>"+data[i].sex+"</td>"
							+"<td>"+data[i].birth+"</td>"
							+"<td>"+data[i].phone+"</td>"
							+"<td>"+data[i].email+"</td>"
							+"<td>"+data[i].offerTime+"</td>"
							+"<td>"+data[i].bishiTest+"</td>"
							+"<td>"+data[i].bishiText+"</td>"
							+"<td>"+data[i].pass+"</td>"
							+"<td>"
									+"<button class='layui-btn layui-btn-radius layui-btn-danger' type='button' onclick='passMian(this)'>通过面试</button>"
									
							+"</td>"
						  +"</tr>"
				 }
				 
				  $("tbody").html(html);
				  
				   
			}
				   
				    
				
				    
			})
	}
	
	
	
	
	
	function passMian(obj)
	{
		userId=$(obj).parent().parent().find("td").eq(0).text();
					
					 userName=$(obj).parent().parent().find("td").eq(1).text();
					 sex=$(obj).parent().parent().find("td").eq(2).text();
					 birth=$(obj).parent().parent().find("td").eq(3).text();
					 phone=$(obj).parent().parent().find("td").eq(4).text();
					 email=$(obj).parent().parent().find("td").eq(5).text();
					 pass="通过面试";
		//用提示框确定用户是否删除
		layer.confirm("确定应聘者已通过面试吗?",{icon:3,title:"警告"},function(index){
		   $.ajax({
		   		url:address+"/offer/updateAjax",
		   		type:"get",
		   		data:{"userId":userId,"userName":userName,
						"sex":sex,"birth":birth,"phone":phone,
						"email":email,"pass":pass},
		   		dataType:"json",
		   		success:function (data) {
		   		   
		   		  if(data.info=="成功")
		   				// layer.close(layer.index);
		   		  window.alert("应聘者已通过面试，并进入企业人力资源储备库!");
		   		  window.location.reload();
		   			}
		   	})
				   
		})
	}
	
	function bi()
	{
		window.location.href="offer.html";
	}
</script>
</html>
